export default {
    template:`
    <div class="my-switch">
        <span :class="{active:!flag}">按年付费</span>
        <label class="switch-btn" :class="{ active:flag }">
            <input type="checkbox" :checked="flag" @change="printSwitchBtnState($event)">
            <span class="pot"></span>
        </label>
        <span :class="{active:flag}">按月付费</span>
    </div>
    `,
    data(){
        return {
           flag:false
        }
    },
    methods:{
        printSwitchBtnState(e){
            this.flag = e.target.checked
        }
    }
}